package ae.pcfc.etks.online.common.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * ServiceAttrValReq entity. @author Mohtisham.Salahria
 */
@Entity
@Table(name = "T_ETKS_SERVICE_ATTR_VAL_REQ", schema = "ETKS_ONLINE_DBA")
@SequenceGenerator(name="SQ_ETKS_SRV_ATTR_VAL_REQ", sequenceName = "SQ_ETKS_SRV_ATTR_VAL_REQ", initialValue = 1, allocationSize = 1)
public class ServiceAttrValReq implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	// Fields

	private Long servAttrReqId;
	private ServiceAttr ServiceAttr;
	private String serviceAttrEng;
	private String serviceAttrArb;
	private String serviceAttrNecessity;
	private User User;
	private String serviceAttrValue;
	private String applicationId;
	private ServiceReq ServiceReq;

	// Constructors

	/** default constructor */
	public ServiceAttrValReq() {
	}

	/** minimal constructor */
	public ServiceAttrValReq(Long servAttrReqId,
			ServiceAttr ServiceAttr, String serviceAttrValue,
			String applicationId) {
		this.servAttrReqId = servAttrReqId;
		this.ServiceAttr = ServiceAttr;
		this.serviceAttrValue = serviceAttrValue;
		this.applicationId = applicationId;
	}

	/** full constructor */
	public ServiceAttrValReq(Long servAttrReqId,
			ServiceAttr ServiceAttr, User User,
			String serviceAttrValue, String applicationId) {
		this.servAttrReqId = servAttrReqId;
		this.ServiceAttr = ServiceAttr;
		this.User = User;
		this.serviceAttrValue = serviceAttrValue;
		this.applicationId = applicationId;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SQ_ETKS_SRV_ATTR_VAL_REQ")
	@Column(name = "SERV_ATTR_REQ_ID", unique = true, nullable = false, precision = 11, scale = 0)
	public Long getServAttrReqId() {
		return this.servAttrReqId;
	}

	public void setServAttrReqId(Long servAttrReqId) {
		this.servAttrReqId = servAttrReqId;
	}


	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SERVICE_ATTR_ID")
	public ServiceAttr getServiceAttr() {
		return this.ServiceAttr;
	}

	public void setServiceAttr(ServiceAttr ServiceAttr) {
		this.ServiceAttr = ServiceAttr;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID")
	public User getUser() {
		return this.User;
	}

	public void setUser(User User) {
		this.User = User;
	}

	@Column(name = "SERVICE_ATTR_VALUE", length = 50)
	public String getServiceAttrValue() {
		return this.serviceAttrValue;
	}

	public void setServiceAttrValue(String serviceAttrValue) {
		this.serviceAttrValue = serviceAttrValue;
	}

	@Column(name = "APPLICATION_ID", nullable = false, length = 2000)
	public String getApplicationId() {
		return this.applicationId;
	}

	public void setApplicationId(String applicationId) {
		this.applicationId = applicationId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SERVICE_REQ_ID")
	public ServiceReq getServiceReq() {
		return ServiceReq;
	}

	/**
	 * @param serviceReq the serviceReq to set
	 */
	public void setServiceReq(ServiceReq serviceReq) {
		ServiceReq = serviceReq;
	}
	
	@Column(name = "SERVICE_ATTR_ENG", nullable = false, length = 100)
	public String getServiceAttrEng() {
		return serviceAttrEng;
	}

	public void setServiceAttrEng(String serviceAttrEng) {
		this.serviceAttrEng = serviceAttrEng;
	}

	@Column(name = "SERVICE_ATTR_ARB", length = 100)
	public String getServiceAttrArb() {
		return serviceAttrArb;
	}

	public void setServiceAttrArb(String serviceAttrArb) {
		this.serviceAttrArb = serviceAttrArb;
	}

	@Column(name = "SERVICE_ATTR_NECESSITY", nullable = false, length = 1)
	public String getServiceAttrNecessity() {
		return serviceAttrNecessity;
	}

	public void setServiceAttrNecessity(String serviceAttrNecessity) {
		this.serviceAttrNecessity = serviceAttrNecessity;
	}

}